1. Field of the Invention
The present invention relates to expert systems implemented by means of digital computers and more particularly to the knowledge base and inference engine components of expert systems, to apparatus for creating expert systems, and to apparatus and methods for creating a definitional knowledge base.
2. Description of the Prior Art: FIGS. 1 and 1A
In recent years expert systems have become commercially available. An expert system is a system which applies information in a given field of expertise in the same fashion as would an expert in the field. Additionally, expert systems resemble human experts in that they are able to some degree to explain themselves. Depending on its complexity, an expert system may explain why it reached a given conclusion, explain why it wants a given piece of information, and permit the user to change the value of a given piece of information and see how that affects the result. Expert systems have been built which perform tasks such as configuring large computer systems, diagnosing bacterial infections, or diagnosing why an oil drilling bit has become stuck and suggesting a remedy.
Prior-art expert systems have generally been rule-based, i.e., they have functioned by applying rules obtained by questioning an expert about his expertise to facts provided by the user of the expert system. The rules are generally of the form
If A then B
In such a rule, A is termed the predicate for B, which is the conclusion. When A is true, then the conclusion may be inferred to be true. For example, one rule in a medical diagnostic system might be "If the patient has a fever and runny nose, he may have the flu." According to this rule, if the symptoms are a fever and runny nose, one possible inference is the flu.
FIG. 1 is a block diagram of a prior-art rule-based expert system 101. System 101 has three components, command processor (CP) 103, rule inference engine (RIE) 105, and rule store (RS) 107. RS 107 contains the rules 109 for the area for which the system is an expert. RIE 105 receives problem data from the user, applies the rules in RS 107 to the data, and provides the result of its application of the rules to the problem data to the user. CP 103 controls RIE 105 by means of inference engine commands (IEC). CP 103 produces the commands from command input provided by the user. To continue with the flu example above, a person using a medical diagnosis expert might input the command to the CP "What disease?" CP 103 would then provide an inference engine command to RIE 105, which would determine that its rules for diseases required symptoms. RIE 105 would then request problem data from the user, perhaps by asking "What symptoms?" The user could then input the symptoms and RIE 105 could then find a rule 109 for which the symptoms were the predicate and return the rule's conclusion as result data. For example, if the input symptoms were "fever and runny nose", expert system 101 could conclude from the rule 109 cited above that the disease might be the flu. Of course, many other ailments have those symptoms, and there would therefore be more than one rule 109 having the symptoms as part of its predicate. Depending on its sophistication, expert system 101 could simply return as results the conclusions of all rules 109 having the symptoms as part of their predicate or could ask the user for more symptoms and use the new symptoms to narrow the number of rules which would apply. in either case, expert system 101 can, at the request of the user, show what rules 109 it used to reach its conclusion.
The first prior-art expert systems 101 were custom-made and required long and close cooperation between an expert, a knowledge engineer, and computer system designers. The expert provided his expertise; the knowledge engineer reduced the expertise to rules 109 and designed RIE 105 and the representation used to store the rules 109 in RS 107. Computer system designers, finally, wrote the programs which implemented the knowledge engineer's design.
The large inputs of professional time required to custom build expert systems 101 made them very expensive and led the makers of expert systems 101 to develop special tools, called expert system shells, for making expert systems. FIG. 1A is a block diagram of an expert system shell 110 for making rule-based experts. As may be seen from that figure, the expert system shell has the components of the rule-based expert of FIG. 1 and an additional component, rule processor (RP) 111. Rule processor 111 is used to produce rules 109 for storage in a RS 107 specific to the expert system currently being built. RIE 105 is used in expert system shell 110 to test the expert system being built as it is constructed. When all of the rules 109 for the expert system being developed have been written and the system has been fully tested, users of the new expert system are given access to RIE 105 and to RS 107 for the new expert.
The usefulness of expert system shells 110 depends to a considerable extent on the sophistication of RP 111. In some systems, RP 111 requires rules 109 input in special forms. Thus, these systems generally require a knowledge engineer and cannot be used by the expert himself. In other systems, RP 111 constructs its rules from examples provided by the expert, and thus does not require a knowledge engineer.
Although rule-based expert systems 101 are becoming steadily more powerful, more usable, and less expensive, their reliance on rules has certain inherent disadvantages. First, most experts do not think about their areas of expertise in terms of a set of rules. Because they do not, a knowledge engineer or a system which constructs rules from examples must mediate between the expert and expert system shell 110. In the first case, the development of expert systems is more expensive than it would be otherwise, and in the second case, the complexity of expert system shell 110 is greater than it would be otherwise and the expert is still not completely insulated from the rules, since he must still check the rules produced by shell 110.
Second, since RS 107 is a collection of rules 109 created independently of each other, there is no guarantee that the collection of rules 109 is complete or contains no contradictory rules. If a set of rules 109 is incomplete, expert system 101 may reach no result or a wrong result; if the set of rules 109 includes contradictory rules 109, expert system 101 may again reach no result or reach a result which depends on RIE 105's internal algorithm for resolving contradictions rather than the rules.
The ability to operate with incomplete sets of rules 109 or with contradictory rules 109 is part of the power of rule-based systems 101 and is required in situations in which the expert is unable to reduce his area of expertise to clear principles. However, expert systems are employed in many situations where the expert can reduce his expertise to clear principles, and in these situations, the ability to deal with incomplete sets of rules 109 and contradictory rules 109 makes detection of mistakes more difficult, and when a mistake is made, makes the behavior of system 101 dependent upon RIE 105's internal algorithms rather than on the rules.
Third, rule-based expert systems 101 are difficult to modify. The behavior of rule-based expert system depends on the totality of its rules, and it is often difficult to determine what rules must be changed if the system's behavior is to be altered because it has bugs or because the expert has changed his mind about how he would deal with a given case.
Fourth, the power and complexity of rule-based expert systems 101 are not required for many situations in which expert systems are useful. Generally speaking, that power and complexity is required where the expert cannot fully define his expertise. However, there are many situations where the layman requires the guidance of an expert but the expert can completely and easily define his expertise. In such situations, useful expert systems and expert system shells need not have the complexity inherent in rule-based expert systems and expert system shells.
One such situation is that presented by complex forms such as tax forms. In most cases, little judgment is required to fill out the form, but the form is nevertheless so involved that many people require the help of a tax preparer. Spread sheets have made it mechanically easier to deal with the data involved in filling out a tax form and permit a user to see how a change in one value affects others, but they have not provided the kind of reasoned guidance for the user which is possible in an expert system. What is needed, therefore, and what is provided by the invention described herein, is an expert system shell which is easier to use than those typical of rule-based systems and expert systems which are substantially simpler than rule-based expert systems, but which provide reasoned expert advice in situations which do not require the full power of rule-based systems.